{{- $inner := .Inner | .Page.RenderString -}}

{{- $iconMap := dict "note" "fas fa-pencil-alt fa-fw" -}}
{{- $iconMap  = dict "abstract" "fas fa-list-ul fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "info" "fas fa-info-circle fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "tip" "fas fa-lightbulb fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "success" "fas fa-check-circle fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "question" "fas fa-question-circle fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "warning" "fas fa-exclamation-triangle fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "failure" "fas fa-times-circle fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "danger" "fas fa-skull-crossbones fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "bug" "fas fa-bug fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "example" "fas fa-list-ol fa-fw" | merge $iconMap -}}
{{- $iconMap  = dict "islam" "fas fa-star-and-crescent fa-fw" | merge $iconMap -}}
{{- $iconDetails := "fas fa-angle-right fa-fw" -}}
<!--
<div class="details admonition note open">
  <div class="details-summary admonition-title">
    <i class="icon fas fa-pencil-alt fa-fw"></i>Note<i class="details-icon fas fa-angle-right fa-fw"></i>
  </div>
  <div class="details-content">
    <div class="admonition-content">
        <strong>Not all</strong> of the below front matters need to be set in each of your posts.
        It is necessary only if the front matters and the <code>page</code> part in your
        <a href="../theme-documentation-basics#site-configuration" rel="">site configuration</a> are inconsistent.
    </div>
  </div>
</div>
-->

{{- $type := .Get 0 | default "note" -}}
<div class="details admonition {{ $type }}{{ if .Get 2 | ne false }} open{{ end }}">
  <div class="details-summary admonition-title">
    <i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default ($type) }}<i class="details-icon {{ $iconDetails }}"></i>
  </div>
  <div class="details-content">
    <div class="admonition-content">
        {{- $inner -}}
    </div>
  </div>
</div>
